import { lazy } from "react";
import { RouteConfig } from "../types";

// 懒加载组件
const UserManagement = lazy(() => import("../../pages/admin/UserManagement"));
const PermissionManagement = lazy(
  () => import("../../pages/admin/PermissionManagement")
);

const adminRoutes: RouteConfig[] = [
  {
    path: "admin",
    meta: {
      title: "系统管理",
      icon: "⚙️",
      requiresAuth: true,
      roles: ["admin"],
      order: 10,
    },
    children: [
      {
        path: "users",
        component: UserManagement,
        meta: {
          title: "用户管理",
          icon: "👥",
          requiresAuth: true,
          roles: ["admin"],
          exact: true,
          order: 1,
          parent: "admin",
        },
      },

      {
        path: "permissions",
        component: PermissionManagement,
        meta: {
          title: "权限管理",
          icon: "🔒",
          requiresAuth: true,
          roles: ["admin"],
          exact: true,
          order: 3,
          parent: "admin",
        },
      },
    ],
  },
];

export default adminRoutes;
